﻿using System;
using System.CodeDom.Compiler;
using System.Reflection;
using System.Runtime.CompilerServices;
using AutoR.Controls;
using DLToolkit.Forms.Controls;
using Prism.Mvvm;
using Syncfusion.ListView.XForms;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;
using Xamarin.Forms.Xaml.Internals;

namespace AutoR.Views.Setting
{
	// Token: 0x02000022 RID: 34
	[XamlFilePath("Views\\Setting\\FriendList.xaml")]
	public class FriendList : ContentPage
	{
		// Token: 0x06000091 RID: 145 RVA: 0x00013CB7 File Offset: 0x00011EB7
		public FriendList()
		{
			this.InitializeComponent();
		}

		// Token: 0x06000092 RID: 146 RVA: 0x00013CC8 File Offset: 0x00011EC8
		[GeneratedCode("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
		private void InitializeComponent()
		{
			if (ResourceLoader.ResourceProvider != null && ResourceLoader.ResourceProvider(typeof(FriendList).GetTypeInfo().Assembly.GetName(), "Views/Setting/FriendList.xaml") != null)
			{
				this.__InitComponentRuntime();
				return;
			}
			if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(base.GetType()) != null)
			{
				this.__InitComponentRuntime();
				return;
			}
			BindingExtension bindingExtension = new BindingExtension();
			Label label = new Label();
			BindingExtension bindingExtension2 = new BindingExtension();
			Button button = new Button();
			StackLayout stackLayout = new StackLayout();
			BindingExtension bindingExtension3 = new BindingExtension();
			DataTemplate dataTemplate = new DataTemplate();
			SfListView sfListView = new SfListView();
			StackLayout stackLayout2 = new StackLayout();
			NameScope value = new NameScope();
			NameScope.SetNameScope(this, value);
			this.SetValue(ViewModelLocator.AutowireViewModelProperty, new bool?(true));
			this.SetValue(Page.TitleProperty, "好友选择");
			stackLayout.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
			label.SetValue(Label.TextProperty, "载入中..");
			label.SetValue(Label.TextColorProperty, Color.Red);
			label.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
			bindingExtension.Path = "IsBusy";
			BindingBase binding = ((IMarkupExtension<BindingBase>)bindingExtension).ProvideValue(null);
			label.SetBinding(VisualElement.IsVisibleProperty, binding);
			stackLayout.Children.Add(label);
			button.SetValue(Button.TextProperty, "确定");
			bindingExtension2.Path = "OKCommand";
			BindingBase binding2 = ((IMarkupExtension<BindingBase>)bindingExtension2).ProvideValue(null);
			button.SetBinding(Button.CommandProperty, binding2);
			button.SetValue(View.HorizontalOptionsProperty, LayoutOptions.EndAndExpand);
			stackLayout.Children.Add(button);
			stackLayout2.Children.Add(stackLayout);
			bindingExtension3.Path = "List";
			BindingBase binding3 = ((IMarkupExtension<BindingBase>)bindingExtension3).ProvideValue(null);
			sfListView.SetBinding(SfListView.ItemsSourceProperty, binding3);
			sfListView.SetValue(SfListView.SelectionModeProperty, SelectionMode.None);
			sfListView.SetValue(View.VerticalOptionsProperty, LayoutOptions.FillAndExpand);
			sfListView.SetValue(SfListView.AutoFitModeProperty, AutoFitMode.Height);
			IDataTemplate dataTemplate2 = dataTemplate;
			FriendList.<InitializeComponent>_anonXamlCDataTemplate_24 <InitializeComponent>_anonXamlCDataTemplate_ = new FriendList.<InitializeComponent>_anonXamlCDataTemplate_24();
			object[] array = new object[0 + 4];
			array[0] = dataTemplate;
			array[1] = sfListView;
			array[2] = stackLayout2;
			array[3] = this;
			<InitializeComponent>_anonXamlCDataTemplate_.parentValues = array;
			<InitializeComponent>_anonXamlCDataTemplate_.root = this;
			dataTemplate2.LoadTemplate = new Func<object>(<InitializeComponent>_anonXamlCDataTemplate_.LoadDataTemplate);
			sfListView.SetValue(SfListView.ItemTemplateProperty, dataTemplate);
			stackLayout2.Children.Add(sfListView);
			this.SetValue(ContentPage.ContentProperty, stackLayout2);
		}

		// Token: 0x06000093 RID: 147 RVA: 0x00013F4A File Offset: 0x0001214A
		private void __InitComponentRuntime()
		{
			this.LoadFromXaml(typeof(FriendList));
		}

		// Token: 0x02000023 RID: 35
		[CompilerGenerated]
		private sealed class <InitializeComponent>_anonXamlCDataTemplate_24
		{
			// Token: 0x06000095 RID: 149 RVA: 0x00013F74 File Offset: 0x00012174
			internal object LoadDataTemplate()
			{
				BindingExtension bindingExtension = new BindingExtension();
				Label label = new Label();
				BindingExtension bindingExtension2 = new BindingExtension();
				Label label2 = new Label();
				BindingExtension bindingExtension3 = new BindingExtension();
				Switch @switch = new Switch();
				StackLayout stackLayout = new StackLayout();
				BindingExtension bindingExtension4 = new BindingExtension();
				DataTemplate dataTemplate = new DataTemplate();
				FlowListView flowListView = new FlowListView();
				StackLayout stackLayout2 = new StackLayout();
				NameScope value = new NameScope();
				NameScope.SetNameScope(stackLayout2, value);
				stackLayout.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
				bindingExtension.Path = "username";
				BindingBase binding = ((IMarkupExtension<BindingBase>)bindingExtension).ProvideValue(null);
				label.SetBinding(Label.TextProperty, binding);
				label.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				stackLayout.Children.Add(label);
				bindingExtension2.StringFormat = "Lv {0}";
				bindingExtension2.Path = "level";
				BindingBase binding2 = ((IMarkupExtension<BindingBase>)bindingExtension2).ProvideValue(null);
				label2.SetBinding(Label.TextProperty, binding2);
				label2.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				label2.SetValue(View.MarginProperty, new Thickness(10.0, 0.0, 0.0, 0.0));
				stackLayout.Children.Add(label2);
				bindingExtension3.Path = "IsSelected";
				BindingBase binding3 = ((IMarkupExtension<BindingBase>)bindingExtension3).ProvideValue(null);
				@switch.SetBinding(Switch.IsToggledProperty, binding3);
				@switch.SetValue(View.HorizontalOptionsProperty, LayoutOptions.EndAndExpand);
				stackLayout.Children.Add(@switch);
				stackLayout2.Children.Add(stackLayout);
				bindingExtension4.Path = "UserShip";
				BindingBase binding4 = ((IMarkupExtension<BindingBase>)bindingExtension4).ProvideValue(null);
				flowListView.SetBinding(FlowListView.FlowItemsSourceProperty, binding4);
				flowListView.SetValue(FlowListView.FlowColumnCountProperty, new int?(6));
				flowListView.SetValue(ListView.HasUnevenRowsProperty, true);
				flowListView.SetValue(VisualElement.HeightRequestProperty, 70.0);
				IDataTemplate dataTemplate2 = dataTemplate;
				FriendList.<InitializeComponent>_anonXamlCDataTemplate_24.<LoadDataTemplate>_anonXamlCDataTemplate_25 <LoadDataTemplate>_anonXamlCDataTemplate_ = new FriendList.<InitializeComponent>_anonXamlCDataTemplate_24.<LoadDataTemplate>_anonXamlCDataTemplate_25();
				int length;
				object[] array = new object[(length = this.parentValues.Length) + 3];
				Array.Copy(this.parentValues, 0, array, 3, length);
				object[] array2 = array;
				array2[0] = dataTemplate;
				array2[1] = flowListView;
				array2[2] = stackLayout2;
				<LoadDataTemplate>_anonXamlCDataTemplate_.parentValues = array2;
				<LoadDataTemplate>_anonXamlCDataTemplate_.root = this.root;
				dataTemplate2.LoadTemplate = new Func<object>(<LoadDataTemplate>_anonXamlCDataTemplate_.LoadDataTemplate);
				flowListView.SetValue(FlowListView.FlowColumnTemplateProperty, dataTemplate);
				stackLayout2.Children.Add(flowListView);
				return stackLayout2;
			}

			// Token: 0x0400004C RID: 76
			internal object[] parentValues;

			// Token: 0x0400004D RID: 77
			internal FriendList root;

			// Token: 0x02000024 RID: 36
			[CompilerGenerated]
			private sealed class <LoadDataTemplate>_anonXamlCDataTemplate_25
			{
				// Token: 0x06000097 RID: 151 RVA: 0x00014208 File Offset: 0x00012408
				internal object LoadDataTemplate()
				{
					BindingExtension bindingExtension = new BindingExtension();
					Label label = new Label();
					BindingExtension bindingExtension2 = new BindingExtension();
					Label label2 = new Label();
					BindingExtension bindingExtension3 = new BindingExtension();
					Bloodbar bloodbar = new Bloodbar();
					StackLayout stackLayout = new StackLayout();
					BindingExtension bindingExtension4 = new BindingExtension();
					Image image = new Image();
					ColumnDefinition columnDefinition = new ColumnDefinition();
					ColumnDefinition columnDefinition2 = new ColumnDefinition();
					ColumnDefinition columnDefinition3 = new ColumnDefinition();
					ColumnDefinition columnDefinition4 = new ColumnDefinition();
					BindingExtension bindingExtension5 = new BindingExtension();
					Image image2 = new Image();
					BindingExtension bindingExtension6 = new BindingExtension();
					Image image3 = new Image();
					BindingExtension bindingExtension7 = new BindingExtension();
					Image image4 = new Image();
					BindingExtension bindingExtension8 = new BindingExtension();
					Image image5 = new Image();
					Grid grid = new Grid();
					StackLayout stackLayout2 = new StackLayout();
					Frame frame = new Frame();
					NameScope nameScope = new NameScope();
					NameScope.SetNameScope(frame, nameScope);
					frame.SetValue(View.MarginProperty, new Thickness(1.0));
					frame.SetValue(Xamarin.Forms.Layout.PaddingProperty, new Thickness(1.0));
					stackLayout2.SetValue(StackLayout.SpacingProperty, 0.0);
					bindingExtension.Path = "Name";
					BindingBase binding = ((IMarkupExtension<BindingBase>)bindingExtension).ProvideValue(null);
					label.SetBinding(Label.TextProperty, binding);
					label.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
					label.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
					label.SetValue(Label.HorizontalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Center"));
					BindableObject bindableObject = label;
					BindableProperty fontSizeProperty = Label.FontSizeProperty;
					IExtendedTypeConverter extendedTypeConverter = new FontSizeConverter();
					string value = "8";
					XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
					Type typeFromHandle = typeof(IProvideValueTarget);
					int length;
					object[] array = new object[(length = this.parentValues.Length) + 3];
					Array.Copy(this.parentValues, 0, array, 3, length);
					object[] array2 = array;
					array2[0] = label;
					array2[1] = stackLayout2;
					array2[2] = frame;
					object service;
					xamlServiceProvider.Add(typeFromHandle, service = new SimpleValueTargetProvider(array2, Label.FontSizeProperty, nameScope));
					xamlServiceProvider.Add(typeof(IReferenceProvider), service);
					Type typeFromHandle2 = typeof(IXamlTypeResolver);
					XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();
					xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
					xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
					xmlNamespaceResolver.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
					xmlNamespaceResolver.Add("control", "clr-namespace:AutoR.Controls;assembly=AutoR");
					xmlNamespaceResolver.Add("syncfusion", "clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms");
					xmlNamespaceResolver.Add("flv", "clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView");
					xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(FriendList.<InitializeComponent>_anonXamlCDataTemplate_24.<LoadDataTemplate>_anonXamlCDataTemplate_25).GetTypeInfo().Assembly));
					xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(29, 171)));
					bindableObject.SetValue(fontSizeProperty, extendedTypeConverter.ConvertFromInvariantString(value, xamlServiceProvider));
					label.SetValue(Label.LineBreakModeProperty, LineBreakMode.NoWrap);
					stackLayout2.Children.Add(label);
					stackLayout.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
					stackLayout.SetValue(View.HorizontalOptionsProperty, LayoutOptions.Center);
					stackLayout.SetValue(VisualElement.WidthRequestProperty, 56.0);
					bindingExtension2.Path = "level";
					bindingExtension2.StringFormat = "Lv{0}";
					BindingBase binding2 = ((IMarkupExtension<BindingBase>)bindingExtension2).ProvideValue(null);
					label2.SetBinding(Label.TextProperty, binding2);
					label2.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
					BindableObject bindableObject2 = label2;
					BindableProperty fontSizeProperty2 = Label.FontSizeProperty;
					IExtendedTypeConverter extendedTypeConverter2 = new FontSizeConverter();
					string value2 = "9";
					XamlServiceProvider xamlServiceProvider2 = new XamlServiceProvider();
					Type typeFromHandle3 = typeof(IProvideValueTarget);
					int length2;
					object[] array3 = new object[(length2 = this.parentValues.Length) + 4];
					Array.Copy(this.parentValues, 0, array3, 4, length2);
					object[] array4 = array3;
					array4[0] = label2;
					array4[1] = stackLayout;
					array4[2] = stackLayout2;
					array4[3] = frame;
					object service2;
					xamlServiceProvider2.Add(typeFromHandle3, service2 = new SimpleValueTargetProvider(array4, Label.FontSizeProperty, nameScope));
					xamlServiceProvider2.Add(typeof(IReferenceProvider), service2);
					Type typeFromHandle4 = typeof(IXamlTypeResolver);
					XmlNamespaceResolver xmlNamespaceResolver2 = new XmlNamespaceResolver();
					xmlNamespaceResolver2.Add("", "http://xamarin.com/schemas/2014/forms");
					xmlNamespaceResolver2.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
					xmlNamespaceResolver2.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
					xmlNamespaceResolver2.Add("control", "clr-namespace:AutoR.Controls;assembly=AutoR");
					xmlNamespaceResolver2.Add("syncfusion", "clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms");
					xmlNamespaceResolver2.Add("flv", "clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView");
					xamlServiceProvider2.Add(typeFromHandle4, new XamlTypeResolver(xmlNamespaceResolver2, typeof(FriendList.<InitializeComponent>_anonXamlCDataTemplate_24.<LoadDataTemplate>_anonXamlCDataTemplate_25).GetTypeInfo().Assembly));
					xamlServiceProvider2.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(31, 131)));
					bindableObject2.SetValue(fontSizeProperty2, extendedTypeConverter2.ConvertFromInvariantString(value2, xamlServiceProvider2));
					label2.SetValue(VisualElement.WidthRequestProperty, 27.0);
					stackLayout.Children.Add(label2);
					bindingExtension3.Path = "HPPercent";
					BindingBase binding3 = ((IMarkupExtension<BindingBase>)bindingExtension3).ProvideValue(null);
					bloodbar.SetBinding(ProgressBar.ProgressProperty, binding3);
					bloodbar.SetValue(VisualElement.WidthRequestProperty, 20.0);
					bloodbar.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
					bloodbar.SetValue(View.HorizontalOptionsProperty, LayoutOptions.EndAndExpand);
					stackLayout.Children.Add(bloodbar);
					stackLayout2.Children.Add(stackLayout);
					bindingExtension4.Path = "SmallImage";
					BindingBase binding4 = ((IMarkupExtension<BindingBase>)bindingExtension4).ProvideValue(null);
					image.SetBinding(Image.SourceProperty, binding4);
					image.SetValue(View.HorizontalOptionsProperty, LayoutOptions.Center);
					image.SetValue(VisualElement.WidthRequestProperty, 56.0);
					image.SetValue(VisualElement.HeightRequestProperty, 15.0);
					stackLayout2.Children.Add(image);
					grid.SetValue(View.HorizontalOptionsProperty, LayoutOptions.Center);
					grid.SetValue(VisualElement.WidthRequestProperty, 56.0);
					grid.SetValue(View.MarginProperty, new Thickness(0.0));
					grid.SetValue(Grid.ColumnSpacingProperty, 0.0);
					columnDefinition.SetValue(ColumnDefinition.WidthProperty, new GridLengthTypeConverter().ConvertFromInvariantString("*"));
					grid.GetValue(Grid.ColumnDefinitionsProperty).Add(columnDefinition);
					columnDefinition2.SetValue(ColumnDefinition.WidthProperty, new GridLengthTypeConverter().ConvertFromInvariantString("*"));
					grid.GetValue(Grid.ColumnDefinitionsProperty).Add(columnDefinition2);
					columnDefinition3.SetValue(ColumnDefinition.WidthProperty, new GridLengthTypeConverter().ConvertFromInvariantString("*"));
					grid.GetValue(Grid.ColumnDefinitionsProperty).Add(columnDefinition3);
					columnDefinition4.SetValue(ColumnDefinition.WidthProperty, new GridLengthTypeConverter().ConvertFromInvariantString("*"));
					grid.GetValue(Grid.ColumnDefinitionsProperty).Add(columnDefinition4);
					bindingExtension5.Path = "Equipment1.Image";
					BindingBase binding5 = ((IMarkupExtension<BindingBase>)bindingExtension5).ProvideValue(null);
					image2.SetBinding(Image.SourceProperty, binding5);
					image2.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
					image2.SetValue(Grid.ColumnProperty, 0);
					grid.Children.Add(image2);
					bindingExtension6.Path = "Equipment2.Image";
					BindingBase binding6 = ((IMarkupExtension<BindingBase>)bindingExtension6).ProvideValue(null);
					image3.SetBinding(Image.SourceProperty, binding6);
					image3.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
					image3.SetValue(Grid.ColumnProperty, 1);
					grid.Children.Add(image3);
					bindingExtension7.Path = "Equipment3.Image";
					BindingBase binding7 = ((IMarkupExtension<BindingBase>)bindingExtension7).ProvideValue(null);
					image4.SetBinding(Image.SourceProperty, binding7);
					image4.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
					image4.SetValue(Grid.ColumnProperty, 2);
					grid.Children.Add(image4);
					bindingExtension8.Path = "Equipment4.Image";
					BindingBase binding8 = ((IMarkupExtension<BindingBase>)bindingExtension8).ProvideValue(null);
					image5.SetBinding(Image.SourceProperty, binding8);
					image5.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
					image5.SetValue(Grid.ColumnProperty, 3);
					grid.Children.Add(image5);
					stackLayout2.Children.Add(grid);
					frame.SetValue(ContentView.ContentProperty, stackLayout2);
					return frame;
				}

				// Token: 0x0400004E RID: 78
				internal object[] parentValues;

				// Token: 0x0400004F RID: 79
				internal FriendList root;
			}
		}
	}
}
